package cn.edu.neusoft.wuguangsheng.market.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

import cn.edu.neusoft.wuguangsheng.market.bean.AllCommentBean;

/**
 * Created by little on 2018/4/22.
 */

public class AllCommentAdapter extends BaseAdapter<AllCommentBean> {
    public AllCommentAdapter(Context context, List<AllCommentBean> items, int layoutResource) {
        super(context, items, layoutResource);
    }
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(context)
                .inflate(layoutResourse, parent, false);
        AllUserCommentViewHolder newCartCardViewHolder = new AllUserCommentViewHolder(itemView);
        return newCartCardViewHolder;
    }
    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        AllUserCommentViewHolder myViewHolder=(AllUserCommentViewHolder)holder;
        AllCommentBean allCommentBean=items.get(position);

        final String uname=allCommentBean.getFoodname();
        myViewHolder.cm_name1.setText("评论人:"+uname);

        final String time=allCommentBean.getCommenttime();
        myViewHolder.cm_time.setText("评论时间:"+time);

        final String content=allCommentBean.getContent();
        myViewHolder.cm_intro.setText("评论内容:"+content);

    }
}
